﻿<%@ Page Title="" Language="C#" MasterPageFile="../main.master" Inherits="VioletDevelopmentLaboratory.Net.Web.PageBase" %>
<%@ Import Namespace="System.IO" %>
<script runat="server">

	protected void Page_Load(object sender, EventArgs e)
	{
		if (!Page.IsPostBack)
		{
			ReadLog();
		}
	}

	protected void ReadLog()
	{
		String logFileFullPath = Path.Combine(Path.Combine(VUtility.WebApplicationPhysicalPath, VWebConfigurationReader.Path.ExceptionLogFolder), Request.QueryString["file"]);

		FileInfo logFile = new FileInfo(logFileFullPath);

		if (logFile.Exists)
		{
			LogContentLiteral.Text = File.ReadAllText(logFileFullPath);
		}
	}

	protected void DeleteButton_Click(object sender, EventArgs e)
	{
		ExceptionLogFile.Delete(Request.QueryString["file"]);

		Response.Redirect("list.aspx", true);
	}
</script>

<asp:Content ID="Content1" ContentPlaceHolderID="BodyContentPlaceHolder" Runat="Server">
	<h2>예외로그 - <%= Request.QueryString["file"]%></h2>

	<div><pre style="font-size : small;"><asp:Literal ID="LogContentLiteral" runat="server" /></pre></div>

	<div><asp:Button ID="DeleteButton" runat="server" onclick="DeleteButton_Click" Text="로그삭제" OnClientClick="<%$ Resources:VGlobalResources, General_Script_RemoveConfirm %>" /></div>
</asp:Content>